<?php
/**
 * Created by PhpStorm.
 * User: paperen
 * Date: 2020/6/17
 */

namespace App\Services;

use GuzzleHttp\Client;

/**
 * class InnerApi
 */
class InnerApi
{

	const TOKEN = '7XJ0A4D&l&zoju@S';

    static public function request($api, $params=[]) {
    	try {
			$http = new Client();
			$response = $http->post(env('INNER_API').$api, [
					'headers' => ['INNERTOKEN' => self::TOKEN],
					'form_params' => $params,
			]);
		} catch (\Exception $e) {
    		return null;
		}
		return @json_decode((string)$response->getBody(), true);
	}

}